#pragma once
//SRM324DIV2_500
//SRM324DIV1_250
2009/10/23 16:29:06
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

class PalindromeDecoding
{
public:
	string decode(string code, vector <int> position, vector <int> length)
	{
		for(int i=0; i<position.size(); i++)
		{
			string sub = code.substr(position[i], length[i]);
			reverse(sub.begin(), sub.end());
			code.insert(position[i]+length[i], sub);
		}
		return code;
	}
};
